-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix panic in 'azurerm_api_management_operation' #5243
Conversation
9511575
to
65e7e73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Brunhil,
thank you for the fix, however we typically don't error when things are missing and instead just ignore the property. Once that change is made this should be good to merge
@@ -250,15 +250,27 @@ func expandApiManagementOperationRequestContract(input []interface{}) (*apimanag | |||
} | |||
|
|||
vs := input[0].(map[string]interface{}) | |||
if vs == nil { | |||
return nil, fmt.Errorf("Error mapping input") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We typically just ignore errors like this
return nil, fmt.Errorf("Error mapping input") | |
return nil, nil |
if headersRaw == nil { | ||
return nil, fmt.Errorf("Error mapping `header`") | ||
} | ||
headers := azure.ExpandApiManagementOperationParameterContract(headersRaw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So instead could we conditionally assign this here upon missing headers instead of an error?
Since this is an enhancement and not a blocking change - we can instead do this in a separate PR post-merging this one; which is blocking other things.
- Don't return error when mapping cannot occur - Conditionally assign value for 'header', 'query_parameter', 'representation'
65e7e73
to
0a3e887
Compare
Fix panic in 'azurerm_api_management_operation' Recreatd #5243 after the changes to the provider organization.
Fix panic in 'azurerm_api_management_operation' Recreatd hashicorp#5243 after the changes to the provider organization.
This has been released in version 1.40.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 1.40.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Fix a panic I was experiencing when the 'description' property was not able to be mapped